import "./index.css"
import React from "react"
import FloatTextfield from "FloatTextfield"
import SwitchLabel from "SwitchLabel"
import ButtonAccent from "ButtonAccent"

var username = ""
var password = ""
export default React.createClass({
  login(){

  },
  registry(){

  },
  updateUsername(e){
    username = e.target.value
  },
  updatePassword(e){
    password = e.target.value
  },
  render(){
    return (
      <div id="login">
        <img src="/logo.svg"/>
        <div id="login-text"> Dmall（上海）内部信息系统 </div>
        <FloatTextfield text="用户名" pattern="^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,7}$" errorMessage="非正确邮箱格式" onChange={this.updateUsername}/>
        <FloatTextfield text="密码" type="password" onChange={this.updatePassword}/>
        <SwitchLabel label="自动登录"/>
        <ButtonAccent id="login-button" text="登录" raised={true}/>
        <ButtonAccent id="login-registry" text="没有账户，点击注册"/>
      </div>
    )
  }
})
